package com.cunshe.service;

import com.cunshe.dao.BannerDao;
import com.cunshe.domain.Banner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 首页横幅
 * @author xiao
 */
@Service
public class BannerService {

    @Autowired
    private BannerDao bannerDao;

    /** 新增 */
    @Transactional(rollbackFor = Exception.class)
    public int insert(Banner record) {
        return bannerDao.insert(record);
    }

    /** 删除 */
    @Transactional(rollbackFor = Exception.class)
    public int delete(Long id) {
        return bannerDao.delete(id);
    }

    /** 修改 */
    @Transactional(rollbackFor = Exception.class)
    public int update(Banner record) {
        return bannerDao.update(record);
    }

    /** 查询列表 */
    public List<Banner> list(Banner record) {
        return bannerDao.list(record);
    }

}